<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <input type="text" v-model="words" id="inp">
    <button>搜索一下</button>
  </div>
  <script src="../vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        words: '看'
      },
      //核心思路:
      // 1 等输入框渲染完成之后
      //2 让输入框获取焦点
      mounted() {
        document.querySelector('#inp').focus()
      }
    })
  </script>
</body>

</html>